package com.tjresearch.api;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.alibaba.dubbo.config.spring.ServiceBean;
import com.tjresearch.api.service.UserService;
import com.tjresearch.api.service.UserServiceImpl;

@Configuration
public class ExportServiceConfig extends DubboBaseConfig {

	@Bean
	public ServiceBean<UserService> userServiceExport(UserServiceImpl userService) {
		ServiceBean<UserService> serviceBean = new ServiceBean<UserService>();
		serviceBean.setProxy("javassist");
		serviceBean.setVersion("myversion");
		serviceBean.setInterface(UserService.class.getName());
		serviceBean.setRef(userService);
		serviceBean.setTimeout(5000);
		serviceBean.setRetries(3);
		return serviceBean;
	}

}
